package com.tnr.scgcxx.controller.info;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.tnr.scgcxx.model.Standard;
import com.tnr.scgcxx.service.info.StandardService;

@Controller @RequestMapping("/info")
public class StandardView {
	
	
	@Resource
	private StandardService standardService;
	
	@RequestMapping(value="/standard_to",method=RequestMethod.GET)
	public String standardTo() {
		return "info/standard";
	}
	
	@GetMapping("/standard_add_to")
	public String standardAddTo() {
		return "info/standard_add";
	}
	
	@GetMapping("/standard_upd_to")
	public String standardUpdTo(String standard_id,Model model) {
		Standard standard=standardService.getStandard(standard_id);
		model.addAttribute("standard", standard);
		return "info/standard_upd";
	}
	
}
